<template>
  <div>
    <div class="resource-manage">
      <div class="card-box box-shadow">
        <div class="card-title">资产信息</div>
        <el-form ref="ruleForm" :model="formObj" class="form-wrap" size="small">
          <el-form-item label="是否有不动产证" prop="isCard">
            <el-radio-group v-model="formObj.isCard" :disabled="true" size="small" @change="handleARealEstateCertificate">
              <el-radio label="2">是</el-radio>
              <el-radio label="1">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="证件类型" prop="cardType">
            <el-select :disabled="true" v-model="formObj.cardType" placeholder="请选择证件类型">
              <el-option v-for="item in realEstateCardType" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="cardNum" prop="cardNum">
            <el-input :disabled="true" v-model="formObj.cardNum" placeholder="请输入不动产证编号"></el-input>
          </el-form-item>
          <el-form-item label="(国标码)资产分类代码" prop="assetClassification">
            <el-select :disabled="true" v-model="formObj.assetClassification" placeholder="请选择（国标码）资产分类代码">
              <el-option v-for="item in assetClassificationList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="资产名称" prop="assetName">
            <el-input :disabled="true" v-model="formObj.assetName" placeholder="请输入资产名称"></el-input>
          </el-form-item>
          <el-form-item label="使用状况" prop="useStatus">
            <el-select :disabled="true" v-model="formObj.useStatus" placeholder="请选择使用状况">
              <el-option v-for="item in useStatusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="取得方式" prop="acquisitionMethod">
            <el-select :disabled="true" v-model="formObj.acquisitionMethod" placeholder="请选择取得方式">
              <el-option v-for="item in acquisitionMethodList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="取得日期" prop="acquisitionDate">
            <el-date-picker :disabled="true" v-model="formObj.acquisitionDate" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item label="投入使用日期" prop="investmentAcquisitionDate">
            <el-date-picker
              :disabled="true"
              v-model="formObj.investmentAcquisitionDate"
              type="date"
              value-format="yyyy-MM-dd"
              format="yyyy-MM-dd"
              placeholder="选择日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="价值类型" prop="valueType">
            <el-select :disabled="true" v-model="formObj.valueType" placeholder="请选择价值类型">
              <el-option v-for="item in valueTypeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="登记价/评估价" prop="registrationPrice">
            <el-input :disabled="true" v-model="formObj.registrationPrice" placeholder="请输入登记价或评估价"></el-input>
          </el-form-item>
          <el-form-item label="登记费" prop="registrationFee">
            <el-input :disabled="true" v-model="formObj.registrationFee" placeholder="请输入登记费"></el-input>
          </el-form-item>
          <el-form-item label="税费" prop="taxation">
            <el-input :disabled="true" v-model="formObj.taxation" placeholder="请输入税费"></el-input>
          </el-form-item>
          <el-form-item label="价值" prop="value">
            <el-input :disabled="true" v-model="formObj.value" placeholder="请输入价值"></el-input>
          </el-form-item>
          <el-form-item label="数量" prop="number">
            <el-input :disabled="true" v-model="formObj.number" placeholder="请输入数量"></el-input>
          </el-form-item>
          <el-form-item label="计量单位(m²)" prop="measurementUnit">
            <el-input :disabled="true" v-model="formObj.measurementUnit" placeholder="请输入计量单位"></el-input>
          </el-form-item>
          <el-form-item label="宗地号" prop="landNumber">
            <el-input :disabled="true" v-model="formObj.landNumber" placeholder="请输入宗地号"></el-input>
          </el-form-item>
          <el-form-item label="宗地面积(m²)" prop="landAreaCard">
            <el-input :disabled="true" v-model="formObj.landAreaCard" placeholder="请输入宗地面积"></el-input>
          </el-form-item>
          <el-form-item label="建筑/土地面积(m²)" prop="landArea">
            <el-input :disabled="true" v-model="formObj.landArea" placeholder="请输入建筑/土地面积"></el-input>
          </el-form-item>
          <el-form-item label="权属证号" prop="ownershipCertificateNo">
            <el-input :disabled="true" v-model="formObj.ownershipCertificateNo" placeholder="请输入权属证号"></el-input>
          </el-form-item>
          <el-form-item label="发证日期" prop="issueData">
            <el-date-picker :disabled="true" v-model="formObj.issueData" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item label="权属年限(月)" prop="ownershipPeriod">
            <!--  -->
            <el-input :disabled="true" v-model="formObj.ownershipPeriod" placeholder="请输入权属年限（月）"></el-input>
          </el-form-item>
          <el-form-item label="权属证明" prop="ownershipCertificate">
            <el-select :disabled="true" v-model="formObj.ownershipCertificate">
              <el-option v-for="item in ownershipCertificateList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="坐落位置" prop="location">
            <el-input :disabled="true" v-model="formObj.location" placeholder="请输入坐落位置"></el-input>
          </el-form-item>
          <el-form-item label="权属性质" prop="ownershipNature">
            <el-select :disabled="true" v-model="formObj.ownershipNature" placeholder="请选择权属性质">
              <el-option v-for="item in ownershipNatureList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="自用面积(m²)" prop="selfUseArea">
            <el-input :disabled="true" v-model="formObj.selfUseArea" placeholder="请输入自用面积"></el-input>
          </el-form-item>
          <el-form-item label="自用价值(元)" prop="selfUseValue">
            <el-input :disabled="true" v-model="formObj.selfUseValue" placeholder="请输入自用价值"></el-input>
          </el-form-item>
          <el-form-item label="建筑结构" prop="buildingStructure">
            <el-select :disabled="true" v-model="formObj.buildingStructure" placeholder="请选择建筑结构">
              <el-option v-for="item in buildingStructureList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="折旧状态" prop="depreStatus">
            <el-select :disabled="true" v-model="formObj.depreStatus" placeholder="请选择折旧状态">
              <el-option v-for="item in assetDepreciationStatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
            <!-- <el-input :disabled="true" v-model="formObj.depreStatus" placeholder="请输入折旧状态"></el-input> -->
          </el-form-item>
          <el-form-item label="累计折旧额(元)" prop="accumDepre">
            <el-input :disabled="true" v-model="formObj.accumDepre" placeholder="请输入累计折旧额"></el-input>
          </el-form-item>
          <el-form-item label="预计使用年限" prop="estimatedLife">
            <el-input :disabled="true" v-model="formObj.estimatedLife" placeholder="请输入预计使用年限"></el-input>
          </el-form-item>
          <el-form-item label="初始折旧月份" prop="initDepreMonth">
            <el-input :disabled="true" v-model="formObj.initDepreMonth" placeholder="请输入初始折旧月份"></el-input>
          </el-form-item>
          <el-form-item label="上次折旧月份" prop="lastDepreMonth">
            <el-input :disabled="true" v-model="formObj.lastDepreMonth" placeholder="请输入上次折旧月份"></el-input>
          </el-form-item>
          <el-form-item label="残值率" prop="salvageValue">
            <el-input :disabled="true" v-model="formObj.salvageValue" placeholder="请输入残值率"></el-input>
          </el-form-item>
          <el-form-item label="是否政府投资项目" prop="assetRegistrationId">
            <el-radio-group v-model="government" disabled size="small">
              <el-radio label="0">是</el-radio>
              <el-radio label="1">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="所属项目" prop="projectId">
            <el-select :disabled="true" v-model="formObj.projectId" placeholder="请选择所属项目">
              <el-option v-for="item in projects" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="土地用途" prop="landType">
            <el-select :disabled="true" v-model="formObj.landType" placeholder="请选择土地用途">
              <el-option v-for="item in landUses" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="规划用途" prop="planningType">
            <el-select :disabled="true" v-model="formObj.planningType" placeholder="请选择规划用途">
              <el-option v-for="item in planUses" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="登记日期" prop="registrationDate">
            <el-date-picker :disabled="true" v-model="formObj.registrationDate" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item label="竣工时间" prop="completionTime">
            <el-date-picker :disabled="true" v-model="formObj.completionTime" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item label="权利人" prop="obligee">
            <el-input :disabled="true" v-model="formObj.obligee" placeholder="请输入权利人"></el-input>
          </el-form-item>
          <el-form-item label="资产编码" prop="assetCode">
            <el-input :disabled="true" v-model="formObj.assetCode" placeholder="请输入资产编码"></el-input>
          </el-form-item>
          <el-form-item label="产权形式" prop="propertyRightForm">
            <el-select :disabled="true" v-model="formObj.propertyRightForm" placeholder="请选择产权形式">
              <el-option v-for="item in propertyRightFormList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item />
          <el-form-item label="物业地址" />

          <el-form-item prop="cityCode" class="full">
            <el-row :gutter="10">
              <el-col :span="4">
                <el-select placeholder="请选择市" v-model="formObj.cityCode" disabled>
                  <el-option v-for="item in cityAssembly" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-select placeholder="请选择区" v-model="formObj.countyCode" disabled>
                  <el-option v-for="item in (this.formObj.cityCode === '') ? [] : districtCollection" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-select placeholder="请选择街道" v-model="formObj.roomStreet" disabled>
                  <el-option
                    v-for="item in (this.formObj.countyCode === '') ? [] : getDict('streets')"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-col>
              <el-col :span="5">
                <el-select placeholder="请选择社区" v-model="formObj.communityName" disabled>
                  <el-option
                    v-for="item in (this.formObj.roomStreet === '') ? [] : getDict('community_names')"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-col>
              <el-col :span="6">
                <el-input maxlength="50" placeholder="请输入道路及门牌号" v-model="formObj.address" disabled></el-input>
              </el-col>
            </el-row>
          </el-form-item>
          <el-form-item label="备注" prop="remarks" class="full">
            <el-input :disabled="true" v-model="formObj.remarks" maxlength="15" placeholder="请输入备注"></el-input>
          </el-form-item>
          <v-upload class="full" :busId="busId" :modelType="modelType" :isView="true" v-model="fileList" />
        </el-form>
      </div>
    </div>

    <div class="resource-manage">
      <div class="card-box box-shadow">
        <div class="card-title">物业信息</div>
        <el-table :row-style="{height:'50px'}" :data="formObj.propertyList" style="width: 100%" class="full">
          <el-table-column prop="propertyCode" label="物业编号" />
          <el-table-column prop="propertyName" label="物业名称" />
          <el-table-column prop="address" label="物业地址" />
          <el-table-column prop="projectStreet" :formatter="streetsFormatter" label="街道" />
          <el-table-column prop="communityName" :formatter="communityNamesFormatter" label="社区" />
          <el-table-column prop="unitConstructionArea" label="面积(m²)" />
        </el-table>
      </div>
    </div>

    <div class="resource-manage" v-show="formObj.assetRegistrationId !== '1'">
      <div class="card-box box-shadow">
        <div class="card-title">政府投资项目登记信息</div>
        <el-table :row-style="{height:'50px'}" :data="formObj.assetRegistrationList" style="width: 100%" class="full">
          <!--          <el-table-column label="项目名称" prop="projectName" align="center"></el-table-column>-->
          <el-table-column label="登记单位" prop="registrationUnit" align="center"></el-table-column>
          <el-table-column label="建设单位" prop="constructionUnit" align="center"></el-table-column>
          <el-table-column label="项目建设地址" prop="constructionAddress" align="center"></el-table-column>
          <el-table-column label="建设开始时间" prop="constructionStartTime" align="center"></el-table-column>
          <el-table-column label="竣工时间" prop="completedTime" align="center"></el-table-column>
          <el-table-column label="资产使用单位" prop="assetUseUnit" align="center"></el-table-column>
        </el-table>
      </div>
    </div>

    <div class="resource-manage unique" v-show="$route.query.type!=='preview'">
      <div class="card-box box-shadow">
        <div class="card-title">入库信息</div>
        <el-form ref="ruleForm2" :model="formObj2" class="form-wrap" size="small" :rules="rules2">
          <el-form-item label="财务核实" prop="warehousingStatus">
            <el-radio-group @change="$refs.ruleForm2.clearValidate()" style="width:100%;" v-model="formObj2.warehousingStatus">
              <el-radio :label="1">入库</el-radio>
              <el-radio :label="3">不入库</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="凭证号" prop="voucherNo2" v-if="formObj2.warehousingStatus=='1'">
            <el-input v-model="formObj2.voucherNo2" placeholder="请输入" maxlength="30"></el-input>
          </el-form-item>
          <el-form-item label="凭证日期" prop="voucherDate" v-if="formObj2.warehousingStatus=='1'">
            <el-date-picker
              v-model="formObj2.voucherDate"
              type="datetimerange"
              format="yyyy-MM-dd HH:mm:ss"
              value-format=" yyyy-MM-dd HH:mm:ss"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item v-if="formObj2.warehousingStatus=='1'"></el-form-item>
          <el-form-item label="备注" prop="warehouseRemark" class="full" v-if="formObj2.warehousingStatus == '1'" :rules="rules2.remarks">
            <el-input v-model="formObj2.warehouseRemark" maxlength="100" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="备注" v-else class="full" prop="warehouseRemark" :rules="[{ required: true, message: '请填写入库信息备注', trigger: 'blur' },]">
            <el-input v-model="formObj2.warehouseRemark" maxlength="100" placeholder="请输入"></el-input>
          </el-form-item>
        </el-form>
        <div style="padding:16px 24px; ">
          <div style="margin-bottom: 5px;">附件</div>

          <v-upload class="full" :busId="wbusId" :modelType="modelType" ref="warehousingFile" @onSuccess="onSuccess" v-model="wfileList"></v-upload>
        </div>
      </div>
    </div>

    <div class="resource-manage" v-show="formObj.assetFixedWarehousingLogList !==[]||$route.query.type!=='preview'">
      <div class="card-box">
        <div class="card-title">编辑历史记录</div>
        <el-form class="form-wrap" size="small" label-width="150px">
          <div v-for="(user,i) in formObj.assetFixedWarehousingLogList" :key="i" class="full">
            <span style="font-size: 20px">{{user.operateBy}}</span>
            <br />
            <br />
            <span style="font-size: 15px">{{user.content}}</span>
            <div style="text-align: right">
              <span style="font-size: 15px;right: 0px">{{user.operateTime}}</span>
            </div>
            <br />
            <br />
          </div>
        </el-form>
      </div>
    </div>
    <div class="resource-manage">
      <div class="card-box">
        <div slot="foot" style="selectProvice-align: right;height: 50px; text-align: right; padding:10px;">
          <el-button type="primary" size="small" @click="$router.push('/asset-management/finance-list')" style="width: 80px" plain>返回</el-button>
          <el-button size="small" @click="resetForm()" style="width: 80px" v-show="$route.query.type!=='preview'">重置</el-button>
          <el-button type="primary" size="small" v-throttle="[sendData]" style="width: 80px" v-show="$route.query.type!=='preview'">保存</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script src='./finance-edit.js'></script>

<style scoped lang="scss">
@import "./finance-edit";

@include formWrap(4);
</style>
